package com.slkj.shilixiaoyuanapp.net.service;

import com.slkj.shilixiaoyuanapp.entity.CommunityEntity;
import com.slkj.shilixiaoyuanapp.entity.CommunityListEntity;
import com.slkj.shilixiaoyuanapp.entity.CommunityNewMessageEntity;
import com.slkj.shilixiaoyuanapp.entity.CommuntiyDetailsEntity;
import com.slkj.shilixiaoyuanapp.entity.PunchClockHistoryEntity;
import com.slkj.shilixiaoyuanapp.net.CommonResult;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * Created  on 2018-08-27
 *
 * @author 唐开阔
 * @describe
 */
public interface CommunityService {
    /**
     * 分页获取社区数据
     *
     * @return
     */
    @FormUrlEncoded
    @POST("classDynamic/getClassDynamic.do")
    Observable<CommonResult<CommunityListEntity>> getCommunityList(@Field("type") int type, @Field("startId") int startId, @Field("page") int page, @Field("count") int count);

    /**
     * 点赞或者取消点赞
     *
     * @param classDynamicId
     * @return
     */
    @FormUrlEncoded
    @POST("classDynamic/addfabulous.do")
    Observable<CommonResult<String>> fabulous(@Field("classDynamicId") int classDynamicId);


    /**
     * 评论或者回复别人的评论
     * @param classDynamicId
     * @return
     */
    @FormUrlEncoded
    @POST("classDynamic/addClassDynamicComment.do")
    Observable<CommonResult<CommunityEntity.Comment>> comment(@Field("classDynamicId") int classDynamicId, @Field("comment") String comment, @Field("commentId") int commentId);

    /**
     * 分页获取与我相关
     */
    @FormUrlEncoded
    @POST("classDynamic/getMessage.do")
    Observable<CommonResult<List<CommunityNewMessageEntity>>> getCommunityMes(@Field("page") int page, @Field("count") int count);


    /**
     * 获取详情
     */
    @FormUrlEncoded
    @POST("classDynamic/getDetails.do")
    Observable<CommonResult<CommuntiyDetailsEntity>> getCommunityDetails(@Field("classDynamicId") int classDynamicId);

}
